﻿#include <iostream>
#include <thread>

#include <zmq.hpp>

#include "../../inc/helper.hpp"

int main()
{
	zmq::context_t ctx;
	zmq::socket_t receiver = zmq::socket_t(ctx, ZMQ_PULL);
	receiver.bind("tcp://*:5558");

	zmq::message_t start_msg;
	receiver.recv(&start_msg);

	absl::Time start_time = absl::Now();
	for (int i = 0; i < 100; ++i)
	{
		zmq::message_t result;
		receiver.recv(&result);

		if (i % 10 == 0)
		{
			std::cout << ":";
		}
		else
		{
			std::cout << ".";
		}
	}
	absl::Duration elapsed_time = absl::Now() - start_time;
	std::cout << "Total elapsed time " << absl::ToDoubleMilliseconds(elapsed_time) << " ms" << std::endl;

	int tmp;
	std::cin >> tmp;
}